<template>
	<view class="app-home" @click="onJumpHome()" v-if="onlyHome">
		<view class="iconfont icon-home"></view>
		<view class="s-tit">首页</view>
	</view>
</template>

<script>
	export default {
		name: 'app-hone',
		props: {},
		data() {
			return {};
		},
		computed: {
			onlyHome() {
				return getCurrentPages().length === 1
			}
		},
		methods: {
			onJumpHome() {
				uni.switchTab({
					url: '/pages/home/index'
				})
			},
		}
	};
</script>

<style lang="scss">
	.app-home {
		position: fixed;
		right: 30upx;
		bottom: 150upx;
		background: rgba(0, 0, 0, 0.5);
		width: 100upx;
		height: 100upx;
		border-radius: 50upx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		color: #fff;

		.iconfont {
			font-size: 46upx;

		}

		.s-tit {
			font-size: 20upx;
		}

	}
</style>
